﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.SessionState;
using PlugNT.Pack.Imager;

namespace PlugNT.Cms.Web.Tools
{
    /// <summary>
    /// 验证码（使用Session时需要继承IRequiresSessionState）
    /// </summary>
    public class VerifyImager : IHttpHandler, IRequiresSessionState
    {

        static VerifyImager()
        {
            VerifyCoder.SessionName = PlugNT.Custom.WebConfig.SessionCode;
        }

        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");

            PlugNT.Pack.Imager.VerifyCoder coder = new PlugNT.Pack.Imager.VerifyCoder();
            coder.context = context;
            coder.Write(5, 16, 17, 25);

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}